<script lang="tsx">
import { defineComponent, computed } from 'vue';
export default defineComponent({
    props: {
        type: String
    },
    setup(props) {
        const requireTypeFilter = (type: string | undefined) => {
            switch (type) {
                case '故事':
                    return { icon: 'iconstory', colorType: 'success' };
                case '改进':
                    return { icon: 'iconleixing-gaijin', colorType: 'warning' };
                case '任务':
                    return { icon: 'iconleixing-renwu', colorType: 'primary' };
                case '缺陷':
                    return { icon: 'iconleixing-quexian', colorType: 'error' };
                case '新功能':
                    return { icon: 'iconleixing-xingongneng', colorType: 'success' };
                case '技术债':
                    return { icon: 'iconjishuzhai', colorType: 'primary' };
                case '建议':
                    return { icon: 'iconsuggest', colorType: 'primary' };
                case '史诗':
                    return { icon: 'iconhistory', colorType: 'primary' };
                default:
                    return { icon: 'iconleixing-quexian', colorType: 'error' };
            }
        };
        const getTypeObj = computed(() => {
            return requireTypeFilter(props.type);
        });
        return () => (
            <flexbox>
                <my-icon type={getTypeObj.value.icon} class={[getTypeObj.value.colorType + '-color']} />
                <span style="margin-left: 4px">{props.type}</span>
            </flexbox>
        );
    }
});
</script>


